import Vue from 'vue';
import VueRouter from 'vue-router';

// 使用插件
Vue.use(VueRouter)

// 导入组件
import Login from '../pages/Login'
import AdminPage from '../pages/AdminPage'
import Register from '../pages/Register'
import Course from '../pages/CoursePage'
import Class from '../pages/ClassPage'
import Subject from '../pages/SubjectPage'
import CourseUpdate from '../components/CourseUpdate'
import ClassUpdate from '../components/ClassUpdate'
import SubjectUpdate from '../components/SubjectUpdate'
import Header from '../components/Header'


// 暴露接口
export default new VueRouter({
    routes: [
        
        {
            path: "/",
            redirect: "/login",
            meta: { show: false }
        },
        {
            path: "/login",
            component: Login,
            meta: { show: false }

        },
        {
            path:"/Adminpage",
            component:AdminPage,
            meta: { show: false },
            children:
            [
                {
                    path:'Course',
                    component:Course,
                },
                
                {
                    path:'Class',
                    component:Class,
                },
                {
                    path:'Subject',
                    component:Subject,
                }

            ]
        },
        {
            path:'/ClassUpdate',
            component:ClassUpdate,
        },
        {
            path:'/Update',
            component:CourseUpdate,
        },
        {
            path:'/SubjectUpdate',
            component:SubjectUpdate,
        },
        {
            path:"/Register",
            component:Register,
            meta:{show:false}
        },
        {
            path:'/Header',
            component:Header,
        }
    ]
})